package com.example.springpoc.controller;

import org.apache.struts.action.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LoginAction {


    public ActionForward login(ActionMapping mapping, ActionForm form,
                               HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ActionErrors errors = new ActionErrors();
        ActionMessages messages = new ActionMessages();

        ActionMessage message = new ActionMessage("my.rigiser.error1");
        messages.add(ActionMessages.GLOBAL_MESSAGE, message);

        request.setAttribute("messages",messages);  //使用自己指定的key: 名为messages
        return mapping.findForward("login_suc");
    }






}